package com.alibaba.citrus.cr.unified.inventory.repository;

import java.util.List;

import com.alibaba.lattice2.epoch.sdk.model.Result;
import com.epoch.app.crunifiedinventory.api.allocateorderread.dto.QueryFrozenAndUnconfirmedAmountRequest;
import com.epoch.app.crunifiedinventory.dto.request.*;
import com.epoch.app.crunifiedinventory.dto.response.*;

import com.epoch.app.crunifiedinventory.model.dto.AllocateOrderCancelReceivedRequest;
import com.epoch.app.crunifiedinventory.model.dto.AllocateOrderCancelReceivedResponse;
import com.epoch.app.crunifiedinventory.model.dto.AllocateOrderDetailGetCustomerRequest;
import com.epoch.app.crunifiedinventory.model.dto.AllocateOrderInfo;
import com.epoch.app.crunifiedinventory.model.dto.AllocateOrderReturnOrderInfoResponse;
import com.epoch.app.crunifiedinventory.model.dto.AllocateOrderReturnOrderRequest;
import com.epoch.app.crunifiedinventory.model.dto.AloocateOrderGetTransResponse;
import com.epoch.app.crunifiedinventory.model.dto.FrozenAndUnconfirmedAmountResponse;
import com.epoch.app.crunifiedinventory.sdo.AllocateOrderDetailSDO;
import com.epoch.app.crunifiedinventory.sdo.AllocateOrderSDO;
import com.epoch.app.crunifiedinventory.sdo.AllocateOrderWithOrderDetailsSDO;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * @description:
 * @author: yuhw
 * @date: 2021年09月16日 19:35
 **/
public interface AllocateOrderReadRepository {

    AllocateOrderInfo find(AllocateOrderRequest request);

    AllocateOrderWithOrderDetailsSDO get(AllocateOrderRequest request);

    AllocateOrderSDO query(AllocateOrderDetailsQueryRequest allocateOrderDetailsQueryRequest);

    List<AllocateOrderSDO> search(AllocateOrderDetailSearchRequest request);

    List<AllocateOrderSDO> queryAllocateOrderSDOByIds(List<Long> ids);

    /**
     * 根据调拨单id获取到 调拨单
     * @param allocateApplyOrderIdList
     * @return
     */
    List<AllocateOrderSDO> queryByAllocateApplyOrderIdList(List<Long> allocateApplyOrderIdList);


    List<AllocateOrderSDO> queryByAllocateApplyOrderCode(String allocateApplyOrderCode);

    /**
     * 获取客户
     * @param code
     * @return
     */
    AllocateOrderGetCustomerResponse getCustomer(String code);

    /**
     * 获取库区
     */
    AllocateOrderGetAreaResponse getArea(String id);


    AllocateOrderGetWarehouseResponse getWarehouse(String id);

    AllocateOrderGetOrganizationResponse getOrganization(String id);

    /**
     * 根据逻辑库区id 查询客户信息
     * @param request
     * @return
     */
    AllocateOrderGetCustomerResponse getCustomer(AllocateOrderGetCustomerRequest request);

    List<com.epoch.app.crunifiedinventory.dto.response.AllocateOrderBatchGetWarehouseResponse> getWarehouse(AllocateOrderGetWarehouseRequest request);


    AllocateOrderDetailsQueryResponse queryDetail(AllocateOrderDetailsQueryRequest allocateOrderDetailsQueryRequest);
//    List<AllocateOrderBatchGetWarehouseResponse> getWarehouse(AllocateOrderGetWarehouseRequest request);

//    List<AloocateOrderGetTransResponse> getTransOrder(AloocateOrderGetTransRequest aloocateOrderGetTransRequest);
    Result<List<AloocateOrderGetTransResponse>> getTransOrder(AloocateOrderGetTransRequest aloocateOrderGetTransRequest);

//    AllocateOrderSDO getAllocateOrderSDO(String id);

    //根据调拨单id批量查询明细
    List<AllocateOrderDetailSDO> queryListByAllocateOrderIds(List<Long> ids);

    //获取退单的请求信息
    AllocateOrderReturnOrderInfoResponse getReturnOrderInfo(AllocateOrderReturnOrderRequest request);


    Result<FrozenAndUnconfirmedAmountResponse> queryFrozenAndUnconfirmedAmount(String companyId);

}
